/* Modernized styles for H5 analysis modules and chart titles */

.h5-analysis-block {
  background: var(--card-bg, #fff);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  padding: 12px 12px;
  margin: 12px 12px;
  border: 1px solid rgba(0,0,0,0.06);
  /* 允许图表的 tooltip 与标签溢出显示 */
  overflow: visible;
}

.chart-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--title-color, #111827);
  line-height: 1.6;
  margin-bottom: 8px;
  position: relative;
}

.chart-title::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 18px;
  border-radius: 3px;
  background: linear-gradient(135deg, #3b82f6 0%, #22c55e 100%);
}

.chart-container {
  /* 高度自适应手机端视口，避免内容看不全 */
  height: min(360px, 55vh);
  width: 100%;
  background: var(--chart-bg, #fafafa);
  border-radius: 10px;
  padding: 4px;
}

.chart-empty {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
}

/* Medium screens: tighten spacing and reduce chart height a bit */
@media (max-width: 768px) {
  .h5-analysis-block {
    margin: 12px 10px;
    padding: 10px 10px;
  }
  .chart-title {
    font-size: 15px;
  }
  .chart-title::before {
    width: 5px;
    height: 16px;
  }
  .chart-container {
    height: min(320px, 55vh);
    padding: 3px;
  }
}

/* Small screens: compact spacing, smaller title, lower chart height */
@media (max-width: 480px) {
  .h5-analysis-block {
    margin: 8px 8px;
    padding: 10px 10px;
  }
  .chart-title {
    font-size: 14px;
    gap: 8px;
  }
  .chart-title::before {
    width: 4px;
    height: 14px;
  }
  .chart-container {
    height: min(300px, 60vh);
    padding: 2px;
  }
}

/* Fine-tune spacing on very small screens */
@media (max-width: 380px) {
  .chart-title {
    font-size: 13px;
  }
  .h5-analysis-block {
    margin: 8px 6px;
    padding: 8px 8px;
  }
  .chart-container {
    height: min(280px, 62vh);
  }
}